'use strict';

define(['services'], function (services) {
    services.system.register('RoleService', ['$resource', function ($resource) {
        return $resource('/rest/system/role/:id', {id: '@id'}, {
            query: {
                isArray: false
            },
            getPrivilegesByRoleId: {
                url: '/rest/system/role/:id/privileges',
                method: 'GET',
                params: {id: '@id'},
                isArray: true
            },
            getPrivileges: {
                url: '/rest/system/role/privileges',
                method: 'GET',
                isArray: true
            },
            getByName: {
                url: '/rest/system/role/getByName',
                method: 'GET',
                isArray: false
            }
        });
    }]);
});